package test1;

import javax.swing.*;

/**
 * @author fengke
 */
public class Demo1 extends JFrame {

    private static final long serialVersionUID = 1L;

    /**
     * 创建绘图面板
     */
    class Plot extends JPanel {
        private static final long serialVersionUID = 1L;
    }


    /**
     * 初始化窗体
     */
    private void initialize(){
        this.setSize(800, 600);
        //设置窗体关闭模式
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        setContentPane(new Plot());
        this.setTitle("绘图小Demo");
        //窗体居中
        this.setLocationRelativeTo(null);
        //设置窗体的可见性
        this.setVisible(true);
    }

    /**
     * Demo类构造器 调用初始化方法
     */
    public Demo1() {
        super();
        initialize();
    }

}
